export const getAngle = (cx, cy, x1, y1, x2, y2) => {
  //2个点之间的角度获取
  let c1 = (Math.atan2(y1 - cy, x1 - cx) * 180) / Math.PI;
  let c2 = (Math.atan2(y2 - cy, x2 - cx) * 180) / Math.PI;
  let angle;
  c1 = c1 <= -90 ? 360 + c1 : c1;
  c2 = c2 <= -90 ? 360 + c2 : c2;

  //夹角获取
  angle = Math.floor(c2 - c1);
  angle = angle < 0 ? angle + 360 : angle;
  return angle;
};

export default {
  getAngle
};
